package com.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@Configuration
public class HandlerExceptionConfig {


    @ExceptionHandler(Exception.class)
    @ResponseBody
    public String handler(Exception e)
    {
        return "出错了:"+e.getMessage();
    }
}
